<div style="display: none">
    <div z-delete-confirm="deleteCluster" z-options="optionsDeleteCluster"></div>
    <div z-cluster-attach-primary-storage="winAttachPrimaryStorage" z-options="optionsAttachPrimaryStorage"></div>
    <div z-cluster-detach-primary-storage="winDetachPrimaryStorage" z-options="optionsDetachPrimaryStorage"></div>
    <div z-cluster-attach-l2-network="winAttachL2Network" z-options="optionsAttachL2Network"></div>
    <div z-cluster-detach-l2-network="winDetachL2Network" z-options="optionsDetachL2Network"></div>
    <div z-create-host="winNewHost" z-options="optionsCreateHost"></div>
</div>

<div class="z-pane">
    <ol class="breadcrumb">
        <li><a href="/#/cluster">{{"cluster.details.CLUSTERS" | translate}}</a></li>
        <li class="active"><a href>{{model.current.name}}</a></li>
    </ol>

    <h1>{{model.current.name}}</h1>

    <div class="z-pane-toolbar" ng-show="funcToolbarShow()">
        <div class="btn-group-sm">
            <button type="button" class="btn btn-default btn-sm z-ribbon-button" ng-click="funcRefresh()">
                <i class="fa fa-refresh"></i>
            </button>
            <div class="btn-group">
                <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
                    {{"cluster.details.Action" | translate}} <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <li><a href ng-click="action.enable()" ng-show="model.current.isEnableShow()">{{"cluster.details.Enable" | translate}}</a></li>
                    <li><a href ng-click="action.disable()" ng-show="model.current.isDisableShow()">{{"cluster.details.Disable" | translate}}</a></li>
                    <li><a href ng-click="action.addHost()">{{"cluster.details.Add Host" | translate}}</a></li>
                    <li><a href ng-click="action.attachL2Network()">{{"cluster.details.Attach L2Network" | translate}}</a></li>
                    <li><a href ng-click="action.detachL2Network()">{{"cluster.details.Detach L2Network" | translate}}</a></li>
                    <li><a href ng-click="action.attachPrimaryStorage()">{{"cluster.details.Attach Primary Storage" | translate}}</a></li>
                    <li><a href ng-click="action.detachPrimaryStorage()">{{"cluster.details.Detach Primary Storage" | translate}}</a></li>
                    <li class="divider"></li>
                    <li><a href style="color:red" ng-click="funcDelete(deleteCluster)">{{"cluster.details.Delete" | translate}}</a></li>
                </ul>
            </div>
        </div>
    </div>

    <ul class="nav nav-pills">
        <li class="active"><a data-target="#info" data-toggle="pill" href>{{"cluster.details.Info" | translate}}</a></li>
        <li><a data-target="#host" data-toggle="pill" href ng-click="funcLoadHosts()">{{"cluster.details.Host" | translate}}</a></li>
        <li><a data-target="#primaryStorage" data-toggle="pill" href ng-click="funcLoadPrimaryStorage()">{{"cluster.details.Primary Storage" | translate}}</a></li>
        <li><a data-target="#l2Network" data-toggle="pill" href>{{"cluster.details.L2 Network" | translate}}</a></li>
    </ul>


    <div class="tab-content">
        <div class="tab-pane active" id="info">
            <tags-input ng-model="optionsTag.tags" display-property="tag" min-length="1"
                        on-tag-added="optionsTag.createTag($tag)" on-tag-removed="optionsTag.deleteTag($tag)"
                        add-on-comma="false" replace-spaces-with-dashes="false" ng-show="optionsTag.isShow()"></tags-input>

            <div class="panel panel-default" z-panel-header-in>
                <div class="panel-heading">
                    <a class="accordion-toggle" data-target="#infoDetails" data-toggle="collapse" href>
                        <i class="z-collapse fa fa-chevron-down"></i>
                        <span>&nbsp; {{"cluster.details.DETAILS" | translate}}</span>
                    </a>
                </div>

                <div id="infoDetails" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <table class="table z-table-borderless">
                            <tr>
                                <td><span class="z-label">{{"cluster.details.DESCRIPTION" | translate}}</span></td>
                                <td><span class="z-description">{{model.current.description}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{"cluster.details.STATE" | translate}}</span></td>
                                <td><span class="{{model.current.stateLabel()}}">{{model.current.state}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{"cluster.details.HYPERVISOR" | translate}}</span></td>
                                <td><span>{{model.current.hypervisorType}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{"cluster.details.UUID" | translate}}</span></td>
                                <td><span>{{model.current.uuid}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{"cluster.details.ZONE UUID" | translate}}</span></td>
                                <td><a href="/#/zone/{{model.current.zoneUuid}}">{{model.current.zoneUuid}}</a></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{"cluster.details.CREATED DATE" | translate}}</span></td>
                                <td><span>{{model.current.createDate}}</span></td>
                            </tr>
                            <tr>
                                <td><span class="z-label">{{"cluster.details.LAST UPDATED DATE" | translate}}</span></td>
                                <td><span>{{model.current.lastOpDate}}</span></td>
                            </tr>
                        </table>
                    </div>

                </div>
            </div>

            <div class="panel panel-default" z-panel-header-in>
                <div class="panel-heading">
                    <a class="accordion-toggle" data-target="#infoCapacities" data-toggle="collapse" href>
                        <i class="z-collapse fa fa-chevron-down"></i>
                        <span>&nbsp; {{"cluster.details.CAPACITIES" | translate}}</span>
                    </a>
                </div>

                <div id="infoCapacities" class="panel-collapse collapse in">
                    <div class="panel-body">
                    </div>
                </div>
            </div>
        </div>

        <div class="tab-pane" id="host">
            <div kendo-grid="hostGrid" k-options="optionsHostGrid" class="z-flat-table"></div>
        </div>

        <div class="tab-pane" id="primaryStorage">
            <div kendo-grid k-options="optionsPrimaryStorageGrid" class="z-flat-table"></div>
            <p class="z-hint">{{"cluster.details.HINT" | translate}}</p>
        </div>

        <div class="tab-pane" id="l2Network">
            <div kendo-grid k-options="optionsL2NetworkGrid" class="z-flat-table"></div>
            <p class="z-hint">{{"cluster.details.HINT2" | translate}}</p>
        </div>
    </div>
</div>
